﻿/**
 *
 * @file    Solid.h
 * @brief   算例相关Python接口封装
 * @author  fulipeng (fulipengqd@yeah.net)
 * @date    2024-10-17
 *
 */

#ifndef  __PYINTERFACE_SOLID_H___
#define  __PYINTERFACE_SOLID_H___

#include <QString>
#include <QObject>
#include <QVariantMap>
#include "WrapperTools.h"
#include "PythonInterfaceAPI.h"

namespace Interface
{
    class FITKAbsGeoCommand;
    class FITKGeoCommandList;
}

/**
 * @brief   体数据封装类
 * @author  fulipeng (fulipengqd@yeah.net)
 * @date    2024-10-17
 */
class Solid
{
public:

    /**
     * @brief     Construct a new Case object
     * @param[i]  id 算例ID
     * @author    fulipeng (fulipengqd@yeah.net)
     * @date      2024-10-17
     */
    Solid(int id = 0);
    Solid(Interface::FITKAbsGeoCommand* command);
    ~Solid();
    bool boxParameterInit(Interface::FITKAbsGeoCommand* command, int modelingType, QList<double> arg1, QList<double> arg2);

    bool sphereParameterInit(Interface::FITKAbsGeoCommand* command, QList<double> arg1, double radius);

    bool chamferParameterInit(Interface::FITKAbsGeoCommand* command, int opCommandID, QList<int> opIndexs, double length);
    /**
     * @brief   获取名称
     * @author  fulipeng (fulipengqd@yeah.net)
     * @date    2024-10-17
     */
    QString getName();

private:
    Interface::FITKAbsGeoCommand* m_command{};
};

/**
 * @brief   体数据装饰器类
 * @author  fulipeng (fulipengqd@yeah.net)
 * @date    2024-10-17
 */
class PythonInterfaceAPI SolidWapper : public QObject
{
    Q_OBJECT
public slots:
    Solid* static_Solid_CreateBox(QString opName, int modelingType, QList<double> arg1, QList<double> arg2);
    Solid* static_Solid_CreateSphere(QString opName, QList<double> arg1, double radius);
    void  delete_Solid(Solid* s);
    QString getName(Solid* s);

    void static_Solid_CreateChamfer(QString editName, QString opName, QList<int> indexs, double length);


    /**
     * @brief   刷新UI
     * @param   caseid 算例ID
     * @author  fulipeng (fulipengqd@yeah.net)
     * @date    2024-10-17
     */
    void updateUI(int caseid);

private:
    Interface::FITKGeoCommandList* geoCmdList{};
    PyWrapperTool::WrapperTools wTools;
};


#endif
